import React, { useEffect, useState } from 'react';

function Hooks (props) {
    // 声明一个新的叫做 “count” 的 state 变量
    const [count, setCount] = useState(0);

    useEffect(() => {
        console.log('------Comp1-------')
    });
    function test () {
        console.log('-----------test-----------')
    }
    console.log('-----------render-Comp1----------')
    return (
        <div>
            <p>You clicked {count} times</p>
            <button onClick={() => setCount(count + 1)}>
                Click me
        </button>
        </div>
    );
}

export default Hooks